package cn.iocoder.yudao.module.reclaim.dal.mysql.productcheckres;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.reclaim.controller.admin.productcheckres.vo.ReclaimCheckResPageReqVO;
import cn.iocoder.yudao.module.reclaim.dal.dataobject.productcheckres.ReclaimCheckResDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 回收核验结果 Mapper
 *
 * @author FFFF
 */
@Mapper
public interface ReclaimCheckResMapper extends BaseMapperX<ReclaimCheckResDO> {

    default PageResult<ReclaimCheckResDO> selectPage(ReclaimCheckResPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ReclaimCheckResDO>()
                .eqIfPresent(ReclaimCheckResDO::getOrderNo, reqVO.getOrderNo())
                .eqIfPresent(ReclaimCheckResDO::getWeightMember, reqVO.getWeightMember())
                .eqIfPresent(ReclaimCheckResDO::getWeightCheckBefore, reqVO.getWeightCheckBefore())
                .eqIfPresent(ReclaimCheckResDO::getWeightCheckAfter, reqVO.getWeightCheckAfter())
                .eqIfPresent(ReclaimCheckResDO::getMetalType, reqVO.getMaterialType())
                .eqIfPresent(ReclaimCheckResDO::getPurePercent, reqVO.getPurePercent())
                .eqIfPresent(ReclaimCheckResDO::getUndeliveryPic, reqVO.getUndeliveryPic())
                .eqIfPresent(ReclaimCheckResDO::getUncheckPic, reqVO.getUncheckPic())
                .eqIfPresent(ReclaimCheckResDO::getCheckPic, reqVO.getCheckPic())
                .betweenIfPresent(ReclaimCheckResDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ReclaimCheckResDO::getIsDeduct, reqVO.getIsDeduct())
                .orderByDesc(ReclaimCheckResDO::getId));
    }

}